﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace YYPostProcessing
{
    public class YYPropertySheet
    {
        public MaterialPropertyBlock properties { get; private set; }
        internal Material material { get; private set; }

        internal YYPropertySheet(Material material)
        {
            this.material = material;
            properties = new MaterialPropertyBlock();
        }


        public void ClearKeywords()
        {
            material.shaderKeywords = null;
        }

        public void EnableKeyword(string keyword)
        {
            material.EnableKeyword(keyword);
        }

        public void DisableKeyword(string keyword)
        {
            material.DisableKeyword(keyword);
        }

        internal void Release()
        {
            YYRuntimeUtilities.Destroy(material);
            material = null;
        }


    }
}
